﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AddFileForm.aspx.vb" Inherits="Training.AddFileForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Training - Training:: Add File</title>
<link rel="Stylesheet" type="text/css" media="screen" href="../css/adminStyle.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="ctr">
        <h2>Add File</h2>
        <p>Use the form below to add a new collateral file</p>
        <asp:Label ID="lblReturn" runat="server" Text="" CssClass="Alert"></asp:Label>
        
        <div style="width:300px;text-align:left;margin:0 auto;" class="text" id="add" runat="server">
            <span class="small">File to upload:</span><br />
            <asp:FileUpload ID="FileUpload1" CssClass="formfield" Width="200" runat="server" /> 
            <asp:RequiredFieldValidator ID="rfFile" runat="server" ErrorMessage="required" 
                CssClass="small" Display="Dynamic" ControlToValidate="FileUpload1" 
                ValidationGroup="adder"></asp:RequiredFieldValidator>
            <br />
            
            <span class="small">Collateral Name:</span><br />
            <asp:TextBox ID="tbCname" ValidationGroup="adder" CssClass="formfield" Width="200" runat="server"></asp:TextBox> 
            <asp:RequiredFieldValidator ID="rfName" runat="server" ErrorMessage="required" 
                CssClass="small" Display="Dynamic" 
                ControlToValidate="tbCname" ValidationGroup="adder"></asp:RequiredFieldValidator>
            <br />
            
            <span class="small">Description*</span><br />
            <asp:TextBox ID="tbDesc" ValidationGroup="adder" CssClass="formfield" Width="200" runat="server"></asp:TextBox> 
            <asp:RequiredFieldValidator ID="rfDesc" runat="server" ErrorMessage="required" 
                CssClass="small" Display="Dynamic" 
                ControlToValidate="tbDesc" ValidationGroup="adder"></asp:RequiredFieldValidator>
            <br />
            <span class="small">(* This is what displays to user)</span><br />
        </div>
        
        <!-- after upload show -->
        <div style="width:300px;text-align:left;margin:0 auto;" visible="false" class="text" id="after" runat="server">
            <p>To associate the uploaded file with a current module, select below.<br />
            If you do not need to associate the file, return to 
            <a href="AddModule.aspx"><b>Add Module</b></a></p>
            
            <asp:HiddenField ID="hfVID" runat="server" />
            <span class="small">Module</span><br />
            <asp:DropDownList ID="ddlModule" runat="server" AppendDataBoundItems="True" 
                CssClass="formfield" DataSourceID="dsModule" DataTextField="ModuleName" 
                DataValueField="ModuleID" ValidationGroup="after">
                <asp:ListItem Value="-1" Text="-select-"></asp:ListItem>
            </asp:DropDownList>
            <asp:RangeValidator ID="rvModule" runat="server" ErrorMessage="required" 
                ControlToValidate="ddlModule" CssClass="small" Display="Dynamic" 
                MaximumValue="9999" MinimumValue="1" Type="Integer" ValidationGroup="after"></asp:RangeValidator>
            
            <asp:SqlDataSource ID="dsModule" runat="server" 
                ConnectionString="<%$ ConnectionStrings:Conn %>" 
                SelectCommand="SELECT [ModuleID], [ModuleName] FROM [TrainingModules] ORDER BY [ModuleName]"></asp:SqlDataSource>
        </div>
        
        <br />
        <asp:Button ID="btnAddFile" runat="server" Text="Upload File" CssClass="button" 
            ValidationGroup="adder" />
        <asp:Button ID="btnAssoc" runat="server" Text="Add To Module" CssClass="button" 
            Visible="false" ValidationGroup="after" />
        <br /><br />
        <p><a href="AddModule.aspx">Add Module</a> - 
        <a href="Default.aspx">Admin Main</a></p>
    </div>
    </form>
</body>
</html>
